<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    function createPhoneNumber(numbers){
        const begin = numbers.slice(0,3).join('')
        const center = numbers.slice(3,6).join('');
        const end = numbers.slice(6,10).join('');
        return `(${begin}) ${center}-${end}`
    }

    console.log(createPhoneNumber([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]))
</script>
</body>
</html>